window.onload=function(){
		//设置默认焦点事件
		document.getElementById('lname-focus6').focus();
}
function setStyle(x){
		document.getElementById(x).style.background="#eeeeee";
		document.getElementById(x).style.borderLeft="5px solid #666";
}
function loss(y){
        document.getElementById(y).style.background="#fafafa";
		document.getElementById(y).style.border="none";
} 



var itemHeight = 40;

function openMenu(obj) {
    menu = document.getElementById('menu1');
    indicator = document.getElementById('indicator1');
    height = menu.style.height;

    if (height == "0px" || height == "") {
        childAmount = menu.getElementsByTagName('div').length;
        height = childAmount * itemHeight;
        menu.style.height = height + "px";
        indicator.style.transform = "rotate(-90deg)";
    } else {
        menu.style.height = "0px";
        indicator.style.transform = "rotate(0deg)";
    }
}
function del(){
			if(confirm("确定删除吗?")){
					var space_id=document.getElementById('space_id').value();
					window.document.location.href="${pageContext.request.contextPath}/deleteSpaceSubmit?id="+space_id;
			}
	}
	function updateSubmit(id){
		if(confirm("确定修改吗?")){
				document.getElementById(id).submit();
		}
	}
var MitemHeight =120;
var MdividerHeight = 1;

function ManageopenMenu(obj) {
    menuTitleId = obj.id;
    menuId = "manage-menu" + menuTitleId.substring(17);
    indicatorId = "manage-indicator" + menuTitleId.substring(17);
	
    menu = document.getElementById(menuId);
    indicator = document.getElementById(indicatorId);
    height = menu.style.height;

    if (height == "0px" || height == "") {
        childAmount = menu.getElementsByTagName('div').length;
        dividerAmount = menu.getElementsByTagName('li').length;
        height = childAmount * MitemHeight + dividerAmount * MdividerHeight;
        menu.style.height = height + "px";
        indicator.style.transform = "rotate(90deg)";
    } else {
        menu.style.height = "0px";
        indicator.style.transform = "rotate(0deg)";
    }
}